<?php
include_once("functions/db_manipulate.php");

if (init()) {
    redirect("?action=login");
    exit();
}

?>
    <meta charset="UTF-8">

<?php

include_once("functions/db_manipulate.php");

if (loginUser($_POST['login'], $_POST['pass'])) {
    redirect("?action=index");
} else {
    redirect($_SERVER['HTTP_REFERER']);
}